﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Prsrp
{
    /// <summary>
    /// Base class for any enemy in the game.
    /// </summary>
    public class BaseEnemy : BaseCharacter
    {
        #region State Definition and Declarations

        public enum EnemyState
        {
            kRunning = BaseCharacterStates.kEnd,
            kAttacking
        }

        public virtual void OnRunning() { throw new NotImplementedException(); }
        public virtual void OnAttacking() { throw new NotImplementedException(); }

        #endregion

        public virtual new void LoadStates()
        {
            base.LoadStates();
            DefineState(EnemyState.kRunning, OnRunning);
            DefineState(EnemyState.kAttacking, OnAttacking);
        }

        public virtual void Callback_OnHit(BaseProjectile _pCurProj)
        {
            miHP -= _pCurProj.miDamage;
            if (miHP <= 0)
            {
                Game.Engine.CurrentLevel.AddParticle(new BigExplosion(mvPos));
                Dispose();
            }
        }

        public override void Update()
        {
            ExecuteStateFunction();
            //HandlePhysics();
        }
    }
}
